﻿using RayDen.Library.Components;
using RayDen.Library.Components.Color;
using RayDen.Library.Components.Volume;
using RayDen.Library.Core.Primitives;

namespace Lt.Engine.Data
{
    public enum PhaseFunctionTypes
    {
        Isotropic,
        HeyneyGreenstein,
        Rayleigh,        
    }


    public class VolumeProfile
    {
        public PhaseFunctionTypes PhaseType = PhaseFunctionTypes.Isotropic;


        public float Phase(ref Vector wi, ref Vector wo, IRadianceEvaluation lambda)
        {
            switch (PhaseType)
            {
                
                case PhaseFunctionTypes.Isotropic:
                default:
                    return PhaseFunctions.PhaseIsotropic(ref wi, ref wo);
                case PhaseFunctionTypes.HeyneyGreenstein:
                    return PhaseFunctions.PhaseHG(ref wi, ref wo, 0.5f);

            }
        }
    }
}

